/****************************************************************************
 * Copyright (C) 2009
 * by Dimok
 * modified by Dj_skual
 *
 * Original Filebrowser by Tantric for libwiigui
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any
 * damages arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any
 * purpose, including commercial applications, and to alter it and
 * redistribute it freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you
 * must not claim that you wrote the original software. If you use
 * this software in a product, an acknowledgment in the product
 * documentation would be appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and
 * must not be misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source
 * distribution.
 *
 * Browser Class
 *
 * Virtual class to inherit the browsers off
 * introducing the minimum of functions need to browse
 *
 * for WiiXplorer 2009
 * for SaveGame Manager GX 2012
 ***************************************************************************/
#ifndef _BROWSER_H_
#define _BROWSER_H_

#include "../GUI/gui_trigger.h"

class Browser : public sigslot::has_slots<>
{
	public:
		Browser() { }
		virtual ~Browser() { }
		
		virtual int BrowsePath(std::string path UNUSED) { return 0; }
		virtual int BrowseDevice(int device UNUSED) { return 0; }
		virtual void BrowseNewPath(std::string path UNUSED) { }
		virtual void BrowseNewDevice(int device UNUSED) { }
		virtual int GetSelIndex() { return 0; }
		virtual void SetSelectedIndex(int ind UNUSED) { }
		virtual int GetEntrieCount() { return 0; }
		virtual void Refresh() { }
		virtual bool IsDir(int ind UNUSED) { return true; }
		virtual bool IsSave(int ind UNUSED) { return true; }
		virtual bool IsDataBin(int ind UNUSED) { return true; }
		virtual bool IsMii(int ind UNUSED) { return true; }
		virtual bool IsNotInstalled(int ind UNUSED) { return true; }
		virtual bool IsCurrentDir() { return IsDir(GetSelIndex()); }
		virtual std::string GetItemName(int ind UNUSED) { return NULL; }
		virtual std::wstring GetItemDisplayName(int ind UNUSED) { return NULL; }
		virtual std::string GetCurrentFilename() { return NULL; }
		virtual std::wstring GetCurrentDisplayname() { return NULL; }
		virtual std::string GetCurrentPath() { return NULL; }
		virtual std::string GetCurrentSelectedFilepath() { return NULL; }
		virtual std::string GetRootDir() { return NULL; }
		virtual u64 GetFilesize(int ind UNUSED) { return 0; }
		virtual int ChangeDirectory() { return 0; }
		virtual void BackInDirectory() { }
		//virtual int ExecuteFile(std::string filepath UNUSED) { return -1; }
		
		virtual std::wstring GetSaveName(int ind UNUSED) { return NULL; }
		virtual std::wstring GetSaveSubname(int ind UNUSED) { return NULL; }
		virtual std::string GetSaveID(int ind UNUSED) { return NULL; }
		virtual u64 GetSaveTid(int ind UNUSED) { return 0; }
		virtual float GetSaveBlocks(int ind UNUSED) { return 0; }
		
		//virtual int GetGCFilenum(int ind UNUSED) { return 0; }
		virtual u8* GetGCFilename(int ind UNUSED) { return NULL; }
		virtual std::wstring GetGCName(int ind UNUSED) { return NULL; }
		virtual std::wstring GetGCSubname(int ind UNUSED) { return NULL; }
		virtual std::string GetGCID(int ind UNUSED) { return NULL; }
		virtual u8 GetGCPermissions(int ind UNUSED) { return 0; }
		virtual float GetGCBlocks(int ind UNUSED) { return 0; }
		
		virtual std::wstring GetMiiName(int ind UNUSED) { return NULL; }
		virtual std::wstring GetMiiCreator(int ind UNUSED) { return NULL; }
		virtual int GetMiiPosition(int ind UNUSED) { return 0; }
		virtual int GetMiiFemale(int ind UNUSED) { return 0; }
		virtual int GetMiiMonth(int ind UNUSED) { return 0; }
		virtual int GetMiiDay(int ind UNUSED) { return 0; }
		virtual int GetMiiFavColor(int ind UNUSED) { return 0; }
		
		virtual int FilterList(std::wstring fileFilter UNUSED = L"") { return 0; }
		virtual std::wstring GetCurrentFilter() { return NULL; }
		std::set<wchar_t> GetSearchChars() { return SearchChars; }
		
		sigslot::signal0<> ListChanged;
		sigslot::signal0<> IndexChanged;
		
	protected:
		std::set<wchar_t> SearchChars;
};

#endif
